```
<%@ page import="com.example.util.DBUtil" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="com.example.dao.UserDao" %>
<%@ page import="com.example.domain.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加用户结果</title>
    <%@ include file="header.jsp" %>
</head>
<body>
<div class="container">
    <div class="header">
        <h1>添加用户结果</h1>
    </div>
    <%
        request.setCharacterEncoding("UTF-8");
        // 获取用户输入
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String email = request.getParameter("email"); // 添加邮箱获取
        
        // 检查输入是否为空
        if (username == null || username.trim().isEmpty() || 
            password == null || password.trim().isEmpty()) {
    %>
        <div class="alert alert-error">
            用户名和密码不能为空！
            <br><br>
            <a href="user_add.jsp" class="btn">返回重新输入</a>
        </div>
    <%
        } else {
            try {
                // 检查用户是否已存在
                String sql = "SELECT * FROM users WHERE username = ?";
                ResultSet rs = null;
                try (var pstmt = DBUtil.getConnection().prepareStatement(sql)) {
                    pstmt.setString(1, username);
                    rs = pstmt.executeQuery();
                    
                    if (rs.next()) {
    %>
                        <div class="alert alert-error">
                            用户 "<%= username %>" 已经存在！
                            <br><br>
                            <a href="user_add.jsp" class="btn">返回重新输入</a>
                        </div>
    <%
                    } else {
                        // 新增用户
                        UserDao userDao = new UserDao(DBUtil.getConnection());
                        User user = new User();
                        user.setUsername(username);
                        user.setPassword(password);
                        user.setEmail(email != null && !email.trim().isEmpty() ? email : ""); // 设置邮箱，如果未填写则为空字符串
                        
                        try {
                            userDao.createUser(user);
    %>
                            <div class="alert alert-success">
                                用户 "<%= username %>" 添加成功！
                                <br><br>
                                <a href="user_info.jsp" class="btn">查看用户列表</a>
                                <a href="user_add.jsp" class="btn">继续添加</a>
                            </div>
    <%
                        } catch (Exception e) {
    %>
                            <div class="alert alert-error">
                                添加用户失败：<%= e.getMessage() %>
                                <br><br>
                                <a href="user_add.jsp" class="btn">返回重新输入</a>
                            </div>
    <%
                        }
                    }
                }
            } catch (Exception e) {
    %>
                <div class="alert alert-error">
                    系统错误：<%= e.getMessage() %>
                    <br><br>
                    <a href="user_add.jsp" class="btn">返回重新输入</a>
                </div>
    <%
            }
        }
    %>
</div>
</body>
</html>
```